home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
pascal
/
xlibpas2.zip
/
XLIB2.DOC
< prev
next >
Wrap
Text File
|
1994-06-12
|
41KB
|
930 lines
╔═══════════════════════════════════════════════════════════════════════════╗
║ ║
║ XLIB v2.0 - Graphics Library for Borland/Turbo Pascal 7.0 ║
║ ║
║ Tristan Tarrant - tristant@cogs.susx.ac.uk ║
║ ║
╠═══════════════════════════════════════════════════════════════════════════╣
║ ║
║ Credits ║
║ ║
║ Themie Gouthas ║
║ ║
║ Matthew MacKenzie ║
║ ║
║ Tore Bastiansen ║
║ ║
║ Andy Tam ║
║ ║
║ Douglas Webb ║
║ ║
║ John Schlagel ║
║ ║
╠═══════════════════════════════════════════════════════════════════════════╣
║ ║
║ I informally reserve all rights to the code in XLIB ║
║ Rights to contributed code is also assumed to be reserved by ║
║ the original authors. ║
║ ║
╚═══════════════════════════════════════════════════════════════════════════╝
╔═══════════════════════════════════════════════════════════════════════════╗
║ DISCLAIMER ║
╚═══════════════════════════════════════════════════════════════════════════╝
This library is distributed AS IS. The author/s specifically disclaim any
responsibility for any loss of profit or any incidental, consequential or
other damages.
╔═══════════════════════════════════════════════════════════════════════════╗
║ INTRODUCTION ║
╚═══════════════════════════════════════════════════════════════════════════╝
XLIB is a "user supported freeware" graphics library specifically designed
with game programming in mind.
It has been placed in the public domain for the benefit of all, and
represents *MANY* hours of work so it is requested that all users comply
with the the wishes of the author/s as specified in the individual modules
and:
a) To leave the code in the public domain
b) Not distribute any modified or incomplete versions of this library
New contribution and comments are welcome and hopefully there will be more
releases as the code evolves.
Finally, do not trust this excuse for a manual if in doubt, as this code has
undergone several revisions. The place to get the answers is in the code
itself.
╔═══════════════════════════════════════════════════════════════════════════╗
║ REQUIREMENTS ║
╚═══════════════════════════════════════════════════════════════════════════╝
Minimum requirements
386 processor,
VGA,
Borland/Turbo Pascal v7.0
╔═══════════════════════════════════════════════════════════════════════════╗
║ GENERAL FEATURES ║
╚═══════════════════════════════════════════════════════════════════════════╝
Support for a number of 256 colour tweaked graphics mode resolutions :
320x200 320x240 360x200 360x240 376x282 320x400 320x480 360x400 360x480
360x360 376x308 376x564 256x200 256x240 256x224 256x256 360x270 400x300
Please note that some of these resolutions best suit monitors with
adjustable vertical height.
Virtual screens larger than the physical screen (memory permitting) that
can be panned at pixel resolution in all directions
A split screen capability
Text functions supporting 8x8 and 8x14 ROM fonts and user defined fonts
Support for page flipping
Graphics primitives such as line and rectangle drawing functions and
of course bit block manipulation functions
Virtual VSync Handler
Compression and archiving
GIF/BMP loading and saving
╔═══════════════════════════════════════════════════════════════════════════╗
║ BUILDING THE LIBRARIES ║
╚═══════════════════════════════════════════════════════════════════════════╝
To compile XLIB use the provided makefile. Just put all of the XLIB files
in the same directory and type MAKE at the DOS prompt. This will build all
the libraries and examples. If Borland Pascal isn't in your path just edit
the makefile where indicated. BP 7.0 and TASM are required to compile the
libraries.
If you want to make units with full debug information, compile with
MAKE -DDEBUG
To make the DPMI versions of the units, compile with
MAKE -DDPMI
╔═══════════════════════════════════════════════════════════════════════════╗
║ USING THE LIBARY WITH YOUR PROGRAMS ║
╚═══════════════════════════════════════════════════════════════════════════╝
Using the XLIB library in your programs is simple. Just include the XLIB
units in the uses statement at the beginning of your program which will make
all the procedures and functions composing the XLIB library available.
╔═══════════════════════════════════════════════════════════════════════════╗
║ GLOBAL CONSTANTS, VARIABLES AND TYPES ║
╚═══════════════════════════════════════════════════════════════════════════╝
Type
Vertex = record
x, y : word;
end; - Vertex record used for xpolygon.
VBMInfoStruc = record
Size, ImageWidth, ImageHeight : word;
end; - Video Bitmap Structure
VBMAlignmentStruc = record
ImagePtr, MaskPtr : word;
end; - Video Bitmap Structure to data in VRAM
AlignmentHeader = record
size, ImageWidth, ImageHeight : word;
alignments : array[0..3] of
record
ImagePtr, MaskPtr : word;
end;
end; - Video Bitmap VRAM stuff
LBMHeader = record
width, height : byte;
end; - Linear/Planar Bitmap header
PAlignmentHeader = ^AlignmentHeader;
- Pointer to VBM VRAM info
Const
XMode320x200 = 0; 320x200x256 colors - 4.0+ pages
XMode320x240 = 1; 320x240x256 colors - 3.4+ pages - Square Pixels
XMode360x200 = 2; 360x200x256 colors - 3.6+ pages
XMode360x240 = 3; 360x240x256 colors - 3.0+ pages
XMode376x282 = 4; 376x282x256 colors - 2.4+ pages - Square Pixels
XMode320x400 = 5; 320x400x256 colors - 2.0+ pages
XMode320x480 = 6; 320x480x256 colors - 1.7+ pages
XMode360x400 = 7; 360x400x256 colors - 1.8+ pages
XMode360x480 = 8; 360x480x256 colors - 1.5+ pages
XMode360x360 = 9; 360x360x256 colors - 2.0+ pages
XMode376x308 = 10; 376x308x256 colors - 2.2+ pages
XMode376x564 = 11; 376x564x256 colors - 1.2+ pages
XMode256x200 = 12; 256x200x256 colors - 5.1+ pages
XMode256x240 = 13; 256x240x256 colors - 4.2+ pages
XMode256x224 = 14; 256x224x256 colors - 4.5+ pages
XMode256x256 = 15; 256x256x256 colors - 4.0